#pragma once
#include <string>
#include <glad/glad.h>
namespace Sivin {
  class Shader {
  public:
    Shader(std::string vertexShaderPath, std::string fragmentShaderPath);
    ~Shader();

  public:
    bool init();
    void start();
    void end();
    void destruct();

  public:
    void setInt(const std::string &name, int value) const {
      glUniform1i(glGetUniformLocation(id, name.c_str()), value);
    }

    void setFloat4(const std::string &name, float f1, float f2, float f3, float f4) {
      glUniform4f(glGetUniformLocation(id, name.c_str()), f1, f2, f3, f4);
    }


  private:
    GLuint id{0};
    bool mInit{false};
    std::string mVertexShaderSource;
    std::string mFragmentShaderSource;
  };

}// namespace Sivin